package com.hanxiaozhang.security;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 功能描述: <br>
 * 〈当前登录用户〉
 *
 * @Author:hanxiaozhang
 * @Date: 2021/3/24
 */
public class CurrentUser extends User {


    public CurrentUser(String username, String password, Long userId, String name, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
        this.setUserId(userId);
        this.setName(name);
    }

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 姓名
     */
    private String name;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
